#define _CRT_SECURE_NO_WARNINGS 1

/**
*  struct ListNode {
*        int val;
*        struct ListNode *next;
*        ListNode(int x) :
*              val(x), next(NULL) {
*        }
*  };
*/
class Solution {
public:
    void _printListFromTailToHead(ListNode* head, vector<int>& _vec)
    {
        if (head == nullptr)
        {
            return;
        }
        _printListFromTailToHead(head->next, _vec);
        _vec.push_back(head->val);
    }
    vector<int> printListFromTailToHead(ListNode* head)
    {
        vector<int> _vec;
        _printListFromTailToHead(head, _vec);
        return _vec;
    }
};

